package cn.udrm.water.base.v1.waterdistribute.dto;

import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import cn.udrm.water.base.v1.waterdistribute.entities.WaterGate;

@Mapper(componentModel="spring")
public interface WaterGateDtoMapper {

	@Mappings({
		@Mapping(source="canalSystem.id", target="canalSystemGuid"),
		@Mapping(source="canalSystem.name", target="canalSystemName"),
		@Mapping(source="waterGateVendor.id", target="waterGateVendorGuid"),
		@Mapping(source="waterGateVendor.name", target="waterGateVendorName")
	})
	public WaterGateDto from(WaterGate waterGate);
	public WaterGate fromWaterGateDto(WaterGateDto waterGateDto);
	
	public List<WaterGateDto> from(List<WaterGate> waterGate);
	
}
